package part3;

import java.util.Random;

/**
 * @author wcj
 * @Date 2021/5/11 14:53
 * @Version 1.0
 */
public class Part34 {
    public static void main(String[] args) {
        // 生成一个随机数生成器，以定值47作为其随机数种子，这样每次生成的随机数生成器一致
        Random random = new Random(47);
        int i = random.nextInt(100) + 1;
        System.out.println("随机整数:" + i);
        float v = random.nextFloat() + 1.0f;
        System.out.println("随机单精度浮点数:" + v);
        long l = random.nextLong();
        System.out.println("随机长整型:" + l);
        double v1 = random.nextDouble();
        System.out.println("随机双精度浮点数:" + v1);
    }
}
